import requests
headers={
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36',
    'referer': 'https://www.bilibili.com/'
}
url = 'https://upos-sz-mirrorcos.bilivideo.com/upgcxcode/94/40/577304094/577304094_nb2-1-30116.m4s?e=ig8euxZM2rNcNbdlhoNvNC8BqJIzNbfqXBvEqxTEto8BTrNvN0GvT90W5JZMkX_YN0MvXg8gNEV4NC8xNEV4N03eN0B5tZlqNxTEto8BTrNvNeZVuJ10Kj_g2UB02J0mN0B5tZlqNCNEto8BTrNvNC7MTX502C8f2jmMQJ6mqF2fka1mqx6gqj0eN0B599M=&uipk=5&nbs=1&deadline=1650854624&gen=playurlv2&os=cosbv&oi=993268842&trid=7898a86f5dc04d2f87cc88f49d2b009cu&platform=pc&upsig=f6e496087a5480e4581acde208058197&uparams=e,uipk,nbs,deadline,gen,os,oi,trid,platform&mid=698136046&bvc=vod&nettype=0&orderid=0,3&agrr=0&bw=329386&logo=80000000'
response = requests.get(url=url,headers=headers).content
with open('./视频.mp4','wb') as f:
    f.write(response)